<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="css/style2.css">
    <script>
        function Calc(obj) {
            var num = document.getElementById("num");
            // console.log(num.value);
            // console.log(obj.value);
            if (num.value >= 0) {
                if (obj.value == "+") {
                    num.value++;
                } else if (num.value >= 1 && obj.value == "-") {
                    num.value--;
                }
            }
        }
    </script>
</head>

<body>
    <div class="count">
        <input type="button" value="-" id="calc" onclick="Calc(this)">
        <input type="text" value="0" id="num">
        <input type="button" value="+" id="calc" onclick="Calc(this)">
    </div>
</body>

</html>